import requests
from rich.console import Console
from typing import TypedDict

console = Console()


class User(TypedDict):
    name: str
    age: int
    email: str
    status: str


def register_user(name: str, age: int, email: str) -> User:
    if age < 18:
        raise ValueError("Age must be at least 18")
    return {"name": name, "age": age, "email": email, "status": "active"}


def main():
    resp = requests.get("https://jsonplaceholder.typicode.com/todos/1")
    console.print(resp.text, style="bold green")
    console.print("Hello from uv-python-hello-world!", style="bold green")


if __name__ == "__main__":
    register_user("张三", 20, "2186256471@qq.com")
    main()
